package com.transboty.wave.extension;

import java.util.logging.Logger;

import service.TransProcessor;

import com.google.wave.api.AbstractRobotServlet;
import com.google.wave.api.RobotMessageBundle;


@SuppressWarnings("serial")
public class TransbotyServlet extends AbstractRobotServlet {
	
	private static final Logger log = Logger.getLogger(TransbotyServlet.class.getName());
	
	static final String APP_NAME = "transboty";
	
	private static final String BOT_ADDRESS = APP_NAME + "@appspot.com";

	@Override
	public void processEvents(RobotMessageBundle bundle) {
		log.info("############START TransBoty##############");
		processBlips(bundle);
		log.info("############END TransBoty##############");
	}
	
	/** Process any blips which have changed. */
	private void processBlips(RobotMessageBundle bundle) {
		
	TransProcessor accproc = TransProcessor.getInstance();
	accproc.applyProcessorsToChangedBlips(bundle,	BOT_ADDRESS);
	}
	
}
